<!DOCTYPE html>

<html>
    <head>
        <title>Page Title</title>
        <meta charset="utf8"/>
        <link href="<?php echo Yii::app()->request->baseUrl . '/css/bootstrap-3.2.0/css/bootstrap.min.css'; ?>" rel="stylesheet" type="text/css"/>
        <script src="<?php echo Yii::app()->request->baseUrl . '/css/bootstrap-3.2.0/js/jquery-1.11.1.min.js'; ?>" type="text/javascript"></script>
        <script src="<?php echo Yii::app()->request->baseUrl . '/css/bootstrap-3.2.0/js/bootstrap.min.js'; ?>" type="text/javascript"></script>
        <style>
            body {}
            ul {width: 100%;padding: 0;}
            li {list-style: none;}
            #header {width: 100%;height: 50px;background-color: #16B5EF;}
            #header a {display: inline-block;margin-top: 8px;}
            #header span {display: inline-block;margin-top: 8px;color: white;font-size: 20px;}

            #content {width: 100%;text-align: center;position: relative;}
            ul.menu {height: 40px;padding-top: 10px;}
            ul.menu li {float: left;width: 25%;border-right: 1px solid #30B06E;}
            ul.menu li:last-child {border: 0;}
            ul.menu li span {border: 1px solid #30B06E;color: #30B06E;font-size: 18px;padding: 1px 4px;border-radius: 3px;}

            ul.box li {width: 100%;}

            .line {margin: 5px 0;box-shadow: 2px 2px 5px #dedede;border-color: #30B06E;}
            .grad-sep {width: 100%;height: 28px;clear: both;margin-top: 15px;background: url(<?php echo Yii::app()->request->baseUrl . '/images/BWeEvent/grad-sep.png'; ?>) no-repeat;background-size: 100% 100%;}

            .item {width: 95%;margin: 20px auto;position: relative;}
            .item h4.lanmu {height: 20px;margin: 0;}
            .item h4.lanmu span {display: inline-block;z-index: 500;padding: 0 10px;color: #777777;}
            .item h4.lanmu span:first-child {float: left;font-weight: bold;}
            .item h4.lanmu span:last-child {float: right;font-weight: normal;}

            .item ul li {border-bottom: 1px solid #cccccc;padding: 5px 0 5px 10px;text-align: left;}
            .item ul li:last-child {border-bottom: 0;}
            .item ul li a {color: #383737;}
            .item ul li span {display: inline-block;margin-left: 10px;}
            .item ul li span:last-child {float: right;margin-right: 10px;}

            .item ul li table {color: gray;}
            .item ul li table h4 {margin: 0;color: #38A2FA;}
        </style>
    </head>

    <body>
        <div id="header">
              <?php
            echo $control->getAjaxLink(array(
                'name' => '<img src="' . Yii::app()->request->baseUrl . '/images/BWeEvent/back.png' . '"/>',
                'id' => 'goIndex'),
                    array(
                'viewName' => 'guanzhe_index_2',
                'htmlOptions' => array(
                    'enctype' => 'multipart/form-data'
            )));
            ?>
            <span>赛事发布</span>
        </div>
        <div id="content">
            <ul class="menu">
                <li><a href="#news"><span>新闻</span></a></li>
                <li><a href="#training"><span>训练</span></a></li>
                <li><a href="#competition"><span>赛事</span></a></li>
                <li><a href="#event"><span>活动</span></a></li>
            </ul>
            <ul class="box">
                <li id="news">
                    <div class="item">
                        <h4 class="lanmu"><span>新闻</span><span>more</span></h4>
                        <hr class="line"/>
                        <ul>
                            <?php
                            if (isset($newsList)) {
                                $i = 0;
                                foreach ($newsList as $content) {
                                    $newsTitle = $content->getItem('newsTitle')->getValue();
                                    $author = $content->getItem('author')->getValue();
                                    //  $cop = $content->getItem('cop')->getValue();
                                    //  $time =$content->getItem('time')->getValue();
                                    $info = $content->getItem('info')->getValue();
                                    $image = $content->getItem('image')->getValue();
                                    if ($i == 0) {
                                        $i++;
                                        ?>
                                        <li>
                                            <table>

                                                <tr>
                                                    <td rowspan="2" style="padding-right: 12px;"><img src="<?php echo Yii::app()->request->baseUrl . $image; ?>" width="100px" height="100px"/></td>
                                                    <td><h4> <?php
                                        echo $control->getAjaxLink(array(
                                            'name' => "$newsTitle",
                                            'id' => 'newsArticle'),
                                                array(
                                            'viewName' => 'newsArticle',
                                            'newsTitle' => $newsTitle,
                                            'author' => $author,
                                            'info' => $info,
                                            'image' => substr($image, 8),
                                            'htmlOptions' => array(
                                                'enctype' => 'multipart/form-data'
                                        )));
                                      
                                        ?></h4></td>
                                                </tr>
                                                <tr>
                                                    <td><?php echo $info; ?></td>
                                                </tr>
                                            </table>
                                        </li>
                                        <?php
                                    } else {
                                        echo $control->getAjaxLink(array(
                                            'name' => "<li>$newsTitle<span>$author</span></li>",
                                            'id' => 'newsArticle'), array(
                                            'viewName' => 'newsArticle',
                                            'newsTitle' => $newsTitle,
                                            'author' => $author,
                                            'info' => $info,
                                             'image' => substr($image, 8),
                                            'htmlOptions' => array(
                                                'enctype' => 'multipart/form-data'
                                        )));
                                    }
                                }
                            }
                            ?>
                        </ul>
                        <div class="grad-sep"></div>
                    </div>
                </li>
                <li id="training">
                    <div class="item">
                        <h4 class="lanmu"><span>训练</span><span>more</span></h4>
                        <hr class="line"/>
                        <ul>
                            <?php
                            if (isset($trainList)) {
                                $i = 0;
                                foreach ($trainList as $content) {
                                    $themeName = $content->getItem('theme')->getValue();
                                    $address = $content->getItem('address')->getValue();
                                    $cop = $content->getItem('Cop')->getValue();
                                    $time = $content->getItem('time')->getValue();
                                    $info = $content->getItem('info')->getValue();
                                    $image = $content->getItem('image')->getValue();
                                    if ($i == 0) {
                                        $i++;
                                        ?>
                                        <li>
                                            <table>
                                                <tr>
                                                    <td rowspan="2" style="padding-right: 12px;"><img src="<?php echo Yii::app()->request->baseUrl . $image; ?>" width="100px" height="100px"/></td>
                                                    <td><h4><?php
                                    echo $control->getAjaxLink(array(
                                        'name' => "$themeName",
                                        'id' => 'newsArticle'),
                                            array(
                                        'viewName' => 'newsArticle',
                                        'newsTitle' => $themeName,
                                        'author' => $address,
                                        'info' => $info,
                                         'image' =>  substr($image, 8),
                                        'htmlOptions' => array(
                                            'enctype' => 'multipart/form-data'
                                    )));
                                    ?></h4></td>
                                                </tr>
                                                <tr>
                                                    <td><?php echo $info; ?></td>
                                                </tr>
                                            </table>
                                        </li>
                                    <?php
                                    } else {
                                        echo $control->getAjaxLink(array(
                                            'name' => "<li>$themeName<span>$time</span></li>",
                                            'id' => 'newsArticle'), array(
                                            'viewName' => 'newsArticle',
                                            'newsTitle' => $themeName,
                                            'author' => $address,
                                            'info' => $info,
                                             'image' => substr($image, 8),
                                            'htmlOptions' => array(
                                                'enctype' => 'multipart/form-data'
                                        )));
                                    }
                                }
                            }
                            ?> 

                        </ul>
                        <div class="grad-sep"></div>
                    </div>
                </li>
                <li id="competition">
                    <div class="item">
                        <h4 class="lanmu"><span>赛事</span><span>more</span></h4>
                        <hr class="line"/>
                        <ul>
                            <?php
                            if (isset($gameList)) {
                                $i = 0;
                                foreach ($gameList as $content) {
                                    $themeName = $content->getItem('theme')->getValue();
                                    $address = $content->getItem('address')->getValue();
                                    $cop = $content->getItem('Cop')->getValue();
                                    $time = $content->getItem('time')->getValue();
                                    $info = $content->getItem('info')->getValue();
                                    $image = $content->getItem('image')->getValue();
                                    if ($i == 0) {
                                        $i++;
                                        ?>
                                        <li>
                                            <table>

                                                <tr>
                                                    <td rowspan="2" style="padding-right: 12px;"><img src="<?php echo Yii::app()->request->baseUrl . $image; ?>" width="100px" height="100px"/></td>
                                                    <td><h4> <?php
                            echo $control->getAjaxLink(array(
                                'name' => "$themeName",
                                'id' => 'newsArticle'),
                                    array(
                                'viewName' => 'newsArticle',
                                'newsTitle' => $themeName,
                                'author' => $cop,
                                'info' => $info,
                                 'image' =>  substr($image, 8),
                                'htmlOptions' => array(
                                    'enctype' => 'multipart/form-data'
                            )));
                            ?></h4></td>
                                                </tr>
                                                <tr>
                                                    <td><?php echo $info; ?></td>
                                                </tr>
                                            </table>
                                        </li>
                                    <?php } else   {
                                        echo $control->getAjaxLink(array(
                                            'name' => "<li>$themeName<span>$time</span></li>",
                                            'id' => 'newsArticle'), array(
                                            'viewName' => 'newsArticle',
                                            'newsTitle' => $themeName,
                                            'author' => $address,
                                            'info' => $info,
                                             'image' => substr($image, 8),
                                            'htmlOptions' => array(
                                                'enctype' => 'multipart/form-data'
                                        )));
                                    }
                                }
                            }
                            ?> 
                        </ul>
                        <div class="grad-sep"></div>
                    </div>
                </li>
                <li id="event">
                    <div class="item">
                        <h4 class="lanmu"><span>活动</span><span>more</span></h4>
                        <hr class="line"/>
                        <ul>
                            <?php
                            if (isset($activityList)) {
                                $i = 0;
                                foreach ($activityList as $content) {
                                    $themeName = $content->getItem('theme')->getValue();
                                    $address = $content->getItem('address')->getValue();
                                    $cop = $content->getItem('Cop')->getValue();
                                    $time = $content->getItem('time')->getValue();
                                    $info = $content->getItem('info')->getValue();
                                    $image = $content->getItem('image')->getValue();
                                    if ($i == 0) {
                                        $i++;
                                        ?>
                                        <li>
                                            <table>
                                                <tr>
                                                    <td rowspan="2" style="padding-right: 12px;"><img src="<?php echo Yii::app()->request->baseUrl . $image; ?>" width="100px" height="100px"/></td>
                                                    <td><h4>  <?php
                                    echo $control->getAjaxLink(array(
                                        'name' => "$themeName",
                                        'id' => 'newsArticle'),
                                            array(
                                        'viewName' => 'newsArticle',
                                        'newsTitle' => $themeName,
                                        'author' => $address,
                                        'info' => $info,
                                         'image' =>  substr($image, 8),
                                        'htmlOptions' => array(
                                            'enctype' => 'multipart/form-data'
                                    )));
                                   
                                    ?></h4></td>
                                                </tr>
                                                <tr>
                                                    <td><?php echo $time; ?></td>
                                                </tr>
                                            </table>
                                        </li>
                                    <?php } else {
                                        echo $control->getAjaxLink(array(
                                            'name' => "<li>$themeName<span>$time</span></li>",
                                            'id' => 'newsArticle'), array(
                                            'viewName' => 'newsArticle',
                                            'newsTitle' => $themeName,
                                            'author' => $address,
                                            'info' => $info,
                                             'image' => substr($image, 8),
                                            'htmlOptions' => array(
                                                'enctype' => 'multipart/form-data'
                                        )));
                                    }
                                }
                            }
                            ?> 
                        </ul>
                        <div class="grad-sep"></div>
                    </div>
                </li>
            </ul>
        </div>
    </body>
</html>
